#ifndef _FILE_H_
#define _FILE_H_

#include <QObject>
#include <QDateTime>

class QByteArray;

namespace Avd {

class File {
public:
	File() {}
	File(const QString& name, const QString& path,
			 unsigned int size = 0, unsigned int version = 0, const QString& modDate = "");
	File(QString& pathName, unsigned int size = 0, unsigned int version = 0);
	File(const File& _file);
	File& operator=(const File& _file);
	~File();

	QString getName() const { return name; }
	QString getTempName() const;
	QString getPath() const { return path; }
	QString getTempPath() const;
	QString getFullPath() const;
	QString getTempFullPath() const;
	QDateTime getModDate() const { return modDate; }
	unsigned int getSize() const { return size; }
	unsigned int getVersion() const { return version; }
	char* getData();
	bool isTemp() const { return temporary; }

	void incrementVersion() { version++; }
	void setData(const char* _data, const unsigned int size);
	void setTemp(const unsigned int part, const unsigned int totalParts);



private:
	QString name;
	QString path;
	QDateTime modDate;
	unsigned int size;
	unsigned int version;
	char* data;
	bool temporary;
	unsigned int part;
	unsigned int totalParts;
};

}

#endif

